var sendData={};
var globalHost=common.globalHost;
var validatePort=common.validatePort;
var url=globalHost+validatePort;
// var resultGetTestCode=baseInfoForm.getTestCode({targetSelector:baseInfoForm.getCode,type:'validate'});
var resultGetTestCode=baseInfoForm.getTestCode({targetSelector:baseInfoForm.getCode});
baseInfoForm.submit.off('tap').on('tap',function(e){
	var $this=$(this);
    var checkCase=$this.hasClass("act-ago");
    	sendData=common.getSendDataByForm(baseInfoForm.form);
    var resultTestCode=baseInfoForm.testMobileCode({targetSelector:baseInfoForm.testCode,noticeMsg:"请输入验证码"});
    var resultTel=baseInfoForm.regTestTel({targetSelector:baseInfoForm.tel,noticeMsg:"手机号",length:11});
    if(!!checkCase&&!!resultTel&&!!resultTestCode){
    	$this.removeClass("act-ago").addClass("acted-yet");
    	baseInfoForm.formPost({
            sendData:sendData,
            url:url,
            resSuccess:function(data){
            	actedStyle ();
            	var data=data.res.data;
            	common.setLocalStorage('H5-agentInfo',JSON.stringify(data));
				baseInfoForm.form[0].reset();    
    			window.location.href='forgetPasswordAmend.html';
            },
            resFailed:function(data){
            	 actAgoStyle (); 
            }
       }); 
    }else{
    	console.log("不准发送ajax");
    }
 	e.preventDefault();
        return false;     
});	
function actedStyle () {
    baseInfoForm.submit.removeClass("act-ago").addClass("acted-yet");
}
function actAgoStyle () {
    baseInfoForm.submit.removeClass("acted-yet").addClass("act-ago");
}